<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>staff</title>
	<script src="__LAYUI__/layui.js"></script>
    <link href="__LAYUI__/css/layui.css" rel="stylesheet"/>
    <link href="__CSS__/index.css" rel="stylesheet"/>
</head>
<body>
	<div id="header" class="layui-header head">
	    <div class="layui-main">
	        <a style="position: absolute;left: 0;top: 16px;" href="#">
	            <img style="height: 81px;display: inline-block;border: none;"
	                 src="https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=113436625,2630828831&fm=27&gp=0.jpg">
	        </a>
	        <div style="padding-top: 51px">
	            <ul class="layui-nav" style="right: 0; position: absolute;" lay-filter="filter">
	                <li class="layui-nav-item layui-this"><a href="">最新活动</a></li>
	                <li class="layui-nav-item "><a href="">产品</a></li>
	                <li class="layui-nav-item"><a href="">大数据</a></li>
	                <li class="layui-nav-item">
	                    <a href="javascript:;">解决方案</a>
	                    <dl class="layui-nav-child"> <!-- 二级菜单 -->
	                        <dd><a href="">移动模块</a></dd>
	                        <dd><a href="">后台模版</a></dd>
	                        <dd><a href="">电商平台</a></dd>
	                    </dl>
	                </li>
	                <li class="layui-nav-item"><a href="javascript:void(0);">账号管理</a></li>
	                <li class="layui-nav-item" name="exit"><a href="javascript:void(0);">退出</a></li>
	            </ul>
	        </div>
	    </div>
	</div>
    <script>
        //注意：导航 依赖 element 模块，否则无法进行功能性操作
        layui.use('element', function () {
            var element = layui.element;

            //…
            element.on('nav(filter)', function (data) {
                var att = data.attr('name');
                if ( att  == 'exit') {
                	console.log('exit');
                	layui.use(['jquery', 'layer'], function(){ 
	  					var $ = layui.$ //重点处
	  					,layer = layui.layer;
                		$.ajax({
                			type: "post",
                			url: 'userExit',
                			success: function (data){
                				if(!data){
                					alert("账号已退出");
                					window.location.href='http://127.0.0.1';
                				}
                			}
                		});
                	});
                }
            });    
        });
    </script>
    <div class="body" style="text-align: center;
    padding: 135px;">
    	<button class="layui-btn layui-btn-big layui-btn-normal" style="width: 160px;
	height: 67px;margin-right: 219px;">教材</button>
		<button class="layui-btn layui-btn-big layui-btn-normal"
		style="width: 160px;
	height: 67px;">专著</button>
    </div>
	
<script type="text/javascript">
	var username=window.localStorage.getItem("username");
	console.log(username);

</script>
</body>
</html>